import {createRouter, createWebHashHistory, createWebHistory} from 'vue-router';
import HomePage from "@/apps/admin/views/HomePage.vue";
import UserManage from "@/apps/admin/views/UserManage.vue";
import DashboardPage from "@/apps/admin/views/DashboardPage.vue";
import InstrumentList from "@/apps/admin/views/InstrumentList.vue";
import VenueList from "@/apps/admin/views/VenueList.vue";


const routes = [
    { path: '/', redirect: '/home' },
    {
        path: '/home',
        component: HomePage, // 父路由
        children: [
            { path: '', name: 'dashboard', components: { mainContainer: DashboardPage }}, // 默认页
            // { path: 'dashboard', name: 'dashboard', components: { mainContainer: DashboardPage }},
            { path: 'userList', name: 'userList', components: { mainContainer: UserManage }},
            // { path: 'userReview', name: 'userReview', components: { mainContainer: UserReview }},
            { path: 'instrumentList', name: 'instrumentList', components: { mainContainer: InstrumentList }},
            { path: 'venueList', name: 'venueList', components: { mainContainer: VenueList }},
            { path: 'timeRuleManagement', name: 'timeRuleManagement', components: { mainContainer: () => import('@/apps/admin/views/TimeRuleManagement.vue') }},
            { path: 'roleManagement', name: 'roleManagement', components: { mainContainer: () => import('@/apps/admin/views/RoleManagement.vue') }},
            { path: 'adminManagement', name: 'adminManagement', components: { mainContainer: () => import('@/apps/admin/views/AdminManagement.vue') }},
            { path: 'systemSettings', name: 'systemSettings', components: { mainContainer: () => import('@/apps/admin/views/SystemSettings.vue') }},
            { path: 'floorManagement', name: 'floorManagement', components: { mainContainer: () => import('@/apps/admin/views/FloorManagement.vue') }},
            { path: 'roomManagement', name: 'roomManagement', components: { mainContainer: () => import('@/apps/admin/views/RoomManagement.vue') }},
            { path: 'cubicleReservationList', name: 'cubicleReservationList', components: { mainContainer: () => import('@/apps/admin/views/CubicleReservationList.vue') }},
            { path: 'meetingReservationManage', name: 'meetingReservationManage', components: { mainContainer: () => import('@/apps/admin/views/MeetingReservationManage.vue') }},
            { path: 'instrumentReservationManage', name: 'instrumentReservationManage', components: { mainContainer: () => import('@/apps/admin/views/InstrumentReservationManage.vue') }},
            { path: 'instrumentLoan', name: 'instrumentLoan', components: { mainContainer: () => import('@/apps/admin/views/InstrumentLoan.vue') }},
            { path: 'instrumentSubTypeManage', name: 'instrumentSubTypeManage', components: { mainContainer: () => import('@/apps/admin/views/InstrumentSubTypeManage.vue') }},
            { path: 'notOutReservationList', name: 'notOutReservationList', components: { mainContainer: () => import('@/apps/admin/views/NotOutReservationList.vue') }}




        ]
    },
    {
        path: '/login',
        name: 'login',
        component: () => import('@/apps/admin/views/LoginPage.vue')
    },
];

const router = createRouter({
    history: createWebHashHistory(),
    routes
});

export default router;
